import request from '@/utils/request'

/* 生成客户编号*/
export function generateCustNo() {
  return request({
    url: '/erp/customer/generateCustNo',
    method: 'post'
  })
}

/* 根据id查询客户*/
export function selectCustomerById(data) {
  return request({
    url: '/erp/customer/selectCustomerById/' + data,
    method: 'post'
  })
}

/* 列表分页*/
export function selectCustomerPage(data) {
  return request({
    url: '/erp/customer/selectCustomerPage',
    method: 'post',
    data: data
  })
}

/* 列表查询*/
export function selectCustomerByName(data) {
  return request({
    url: '/erp/customer/selectCustomerByName',
    method: 'post',
    data: data
  })
}

/* 新增*/
export function saveCustomer(data) {
  return request({
    url: '/erp/customer/saveCustomer',
    method: 'post',
    data: data
  })
}

/* 修改*/
export function updateCustomerById(data) {
  return request({
    url: '/erp/customer/updateCustomerById',
    method: 'post',
    data: data
  })
}

/* 删除*/
export function deleteCustomer(data) {
  return request({
    url: '/erp/customer/deleteCustomer',
    method: 'post',
    data: data
  })
}

/* 提交*/
export function submitApproval(data) {
  return request({
    url: '/erp/customer/submit/' + data,
    method: 'post'
  })
}

/* 查询带索引的客户信息*/
export function selectAllCustomerWithIndex(data) {
  return request({
    url: '/erp/customer/selectAllCustomerWithIndex',
    method: 'post',
    data: data
  })
}
